package com.css.crm.dao.impl;

import java.util.List;
import org.apache.ibatis.session.SqlSession;
import com.css.crm.dao.CustomerEmailDao;
import com.css.crm.vo.CustomerEmailVo;

/**
 * Implementation for CustomerEmailDao
 * 
 * @author AIS
 */
/**
 * @author Administrator
 * 
 */
public class CustomerEmailDaoImpl extends BaseDaoImpl implements CustomerEmailDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerEmailDao#getCustomerEmailByCustId(java.lang.String
	 * )
	 */
	@Override
	public List<CustomerEmailVo> getCustomerEmailByCustId(String custId) {
		SqlSession session = getMyBatisSession();
		return session.selectList("customerEmail.getCustomerEmailByCustId", custId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.CustomerEmailDao#insertCustomerEmail(com.css.crm.vo.
	 * CustomerEmailVo)
	 */
	@Override
	public int insertCustomerEmail(CustomerEmailVo customerEmail) {
		SqlSession session = getMyBatisSession();
		return session.insert("customerEmail.insertCustomerEmail", customerEmail);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerEmailDao#updateCustomerEmailByPK(com.css.crm.
	 * vo.CustomerEmailVo)
	 */
	@Override
	public int updateCustomerEmailByPK(CustomerEmailVo customerEmail) {
		SqlSession session = getMyBatisSession();
		return session.update("customerEmail.updateCustomerEmailByPK", customerEmail);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerEmailDao#deleteCustomerEmailByPK(java.lang.Long)
	 */
	@Override
	public int deleteCustomerEmailByPK(Long custEmailId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerEmail.deleteCustomerEmailByPK", custEmailId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerEmailDao#deleteCustomerEmailByCustId(java.lang
	 * .String)
	 */
	@Override
	public int deleteCustomerEmailByCustId(String CustId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerEmail.deleteCustomerEmailByCustId", CustId);
	}
}
